﻿<!DOCTYPE html>
<html>

<head id="Head1" runat="server">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>管理考核看板</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="Shortcut Icon" href="../images/aecc.ico" type="image/x-icon" />
  <link rel="stylesheet" href="../StaticFiles/layui/dist/css/layui.css" />
  <link rel="stylesheet" href="../StaticFiles/layui/admin.css" />
  <link rel="stylesheet" href="../styles/pace.css" />
  <script type="text/javascript" src="../Scripts/pace.min.js"></script>
  <script type="text/javascript" src="../Scripts/json2.js"></script>
  <script type="text/javascript" src="../Scripts/jquery-1.11.2.min.js"></script>
  <style type="text/css">
    html {
      background-image: url(../images/bg.jpg);
      background-repeat: no-repeat;
    }

    .layui-card {
      background-color: transparent;
      border: 1px dashed #1E9FFF;
    }

    .layui-card-header {
      color: #fff;
      border: none;
      text-align: center;
      font-size: 20px;
      font-weight: bold;
      letter-spacing: 0.1em;
    }

    /*左上图片*/
    .bg-left-top {
      position: absolute;
      left: -2px;
      top: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/left-top.png);
    }

    /*左下图片*/
    .bg-left-bottom {
      position: absolute;
      left: -2px;
      bottom: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/left-bottom.png);
    }

    /*右上图片*/
    .bg-right-top {
      position: absolute;
      right: -2px;
      top: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/right-top.png);
    }

    /*右下图片*/
    .bg-right-bottom {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/right-bottom.png);
    }

    .lable {
      font-size: 20px;
      font-weight: bold;
      color: #fff;
      padding: 10px;
    }

    .yfzs {
      font-size: 50px;
      color: #fff;
      font-weight: bold;
      margin: 20px;
      cursor: pointer;
    }

    .kaohe-lable {
      font-size: 20px;
      font-weight: bold;
      color: #fff;
      margin: 10px 0px;
    }

    .cqrw,
    .wdbrw,
    .wc-score,
    .cs-problem,
    .cs-wdbrw,
    .cs-score {
      font-size: 50px;
      font-weight: bold;
      color: #fff;
      cursor: pointer;
      padding: 10px 0px;
    }


    .layui-table-cell {
      text-align: center;
    }

    .layui-layer-title {
      text-align: center;
      font-weight: bold;
      font-size: 18px !important;
      color: #009688 !important;
    }

    .layui-table-header th {
      font-weight: bold;
      font-size: 30x;
      text-align: center;
      color: #009688;
    }
  </style>
</head>

<body>
  <!--[if lt IE 9]>
        <script src="../Scripts/pollyfills/es5-shim.min.js"></script>
        <script src="../Scripts/pollyfills/es5-sham.min.js"></script>
        <script src="../Scripts/pollyfills/html5.js"></script>
        <script src="../Scripts/pollyfills/response.js"></script>
    <![endif]-->
  <div class="layui-row" style="padding: 10px 15px;">
    <div class="layui-col-md3">
      <div>
        <img src="../images/aeec_logo.png" alt="" height="60" />
      </div>
    </div>
    <div class="layui-col-md6" style="height: 60px; line-height: 60px; text-align: center;
            font-size: 40px; letter-spacing: 0.1em; color: #fff;">
      装配厂管理考核看板
    </div>
    <div class="layui-col-md3" style="height: 60px; line-height: 60px; text-align: right;
            font-size: 16px; font-weight: bold; color: #fff;" id="currentTime">
    </div>
  </div>

  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/分布.png" height="30" alt="" />
            本月任务机型分布
          </div>
          <div class="layui-card-body">
            <div id="pfPie" style="height:200px;">
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/遗留.png" height="30" alt="" />
            各中心剩余任务
          </div>
          <div class="layui-card-body">
            <div class="layui-row" id="taskInfo">
              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                  </div>
                  <div class="layui-card-body" style="text-align:center;">
                    <img src="../images/任务.png" height="30" alt="" />
                    <h3 class="lable">任务数</h3>
                    <p class="yfzs">0</p>
                  </div>
                </div>
              </div>
              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                  </div>
                  <div class="layui-card-body" style="text-align:center;">
                    <img src="../images/任务.png" height="30" alt="" />
                    <h3 class="lable">任务数</h3>
                    <p class="yfzs">0</p>
                  </div>
                </div>
              </div>
              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                  </div>
                  <div class="layui-card-body" style="text-align:center;">
                    <img src="../images/任务.png" height="30" alt="" />
                    <h3 class="lable">任务数</h3>
                    <p class="yfzs">0</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-12">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/任务.png" height="30" alt="" />
            各中心任务完成情况
          </div>
          <div class="layui-card-body">
            <div id="zxrw" style="height:200px;">
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-12">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/得分.png" height="30" alt="" />
            中心及处室考核情况
          </div>
          <div class="layui-card-body">
            <div class="layui-row" id="workcenter">
              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/涡喷.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产任务</h3>
                        <p class="cqrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="wc-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="layui-col-md4">
                <div class="layui-card strap" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/风扇.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产任务</h3>
                        <p class="cqrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="wc-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/火箭.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产任务</h3>
                        <p class="cqrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="wc-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-row" id="chushi">
              <div class="layui-col-md4">
                <div class="layui-card strap" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/技术.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产问题</h3>
                        <p class="cs-problem">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="cs-wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="cs-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="layui-col-md4">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/管理.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产问题</h3>
                        <p class="cs-problem">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="cs-wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="cs-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="layui-col-md4">
                <div class="layui-card strap" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/保障.png" alt="" height="30" />
                    <span class="wc-title"></span>
                  </div>
                  <div class="layui-card-body">
                    <div class="layui-row">
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/超期.png" height="30" alt="" />
                        <h3 class="kaohe-lable">超期生产问题</h3>
                        <p class="cs-problem">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/未达标.png" height="30" alt="" />
                        <h3 class="kaohe-lable">未达标任务</h3>
                        <p class="cs-wdbrw">0</p>
                      </div>
                      <div class="layui-col-md4" style="text-align:center;">
                        <img src="../images/得分.png" height="30" alt="" />
                        <h3 class="kaohe-lable">考核得分</h3>
                        <p class="cs-score">0</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script src="../Scripts/echarts/echarts-5.4.0.min.js"></script>
  <script type="text/javascript" src="../StaticFiles/layui/dist/layui.js"></script>
  <script type="text/javascript">
    $(function () {
      $(".layui-card:last-child").css({ "marginBottom": "0px" });
      function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
      };
      var $factoryid = getUrlParam('factoryid');

      // 页面右上方时钟
      function showTime() {
        var currentTime = new Date();
        var year = currentTime.getFullYear();
        var month = currentTime.getMonth() + 1;
        var date = currentTime.getDate();
        var day = currentTime.getDay();
        var hours = currentTime.getHours();
        var minutes = currentTime.getMinutes();
        var seconds = currentTime.getSeconds();
        var time = document.getElementById("currentTime");
        if (seconds < 10) {
          seconds = "0" + seconds;
        }
        if (minutes < 10) {
          minutes = "0" + minutes;
        }
        time.innerHTML = year + "年" + month + "月" + date + "日   " + hours + " : " + minutes + " : " + seconds;
      };
      setInterval(showTime, 500);

      layui.use(['layer', 'table'], function () {
        var table = layui.table;
        var layer = layui.layer;

        //弹出层通用方法
        function openDialog(config) {
          layer.open({
            title: config.title,
            type: 1,
            content: "<table class='layui-hide' id='test'></table>",
            area: ['100%', '100%'],
            skin: 'layui-layer-rim',
            success: function (layero) {
              table.render({
                elem: '#test',
                url: config.url,
                method: config.method,
                cols: config.cols,
                where: config.QueryString,
                request: {
                  pageName: 'page', //页码的参数名称，默认：page
                  limitName: 'rows' //每页数据量的参数名，默认：limit
                },
                cellMinWidth: 80,
                page: {
                  theme: '#1E9FFF'
                },
                text: {
                  none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
                }
              });
            }
          });
        };

        //本月任务机型分布(饼图)
        function GetProductFamilyInfo() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSKaoHeLookBoard.ashx?type=GetProdutfamily",
            dataType: "text",
            cashe: false,
            beforeSend: function () {
              echarts.dispose(document.getElementById("pfPie"));
              var chart = echarts.init(document.getElementById('pfPie'));
              chart.showLoading({
                text: '数据查询中...',
                effect: 'whirling',
                maskColor: 'transparent',
                textColor: '#ffffff'
              });
            },
            success: function (result) {
              var data = JSON.parse(result);

              echarts.dispose(document.getElementById("pfPie"));
              var chart = echarts.init(document.getElementById('pfPie'));
              chart.hideLoading();

              var pieData = [];
              var legendData = [];

              for (var i = 0; i < data.length; i++) {
                pieData.push({
                  value: data[i]["QTY"],
                  name: data[i]["PRODUCTFAMILYNAME"]
                });
                legendData.push(data[i]["PRODUCTFAMILYNAME"]);
              };

              var option = {
                tooltip: {
                  trigger: 'item',
                  formatter: "{a} <br/>{b}: {c} ({d}%)"
                },
                grid: {
                  left: '1%',
                  right: '1%',
                  bottom: '3%',
                  containLabel: true
                },
                legend: {
                  orient: 'vertical',
                  x: 'left',
                  data: legendData,
                  textStyle: {
                    fontSize: '12',
                    fontWeight: 'bold',
                    color: '#fff'
                  }
                },
                color: ['#00ff00', '#ff6700', '#00BFFF', '#FFF', '#00FFFF', '#F0FFF0', '#ffff00'],
                series: [
                  {
                    name: '机型',
                    type: 'pie',
                    radius: ['50%', '70%'],
                    center: ["65%", "55%"],
                    avoidLabelOverlap: true,
                    hoverAnimation: false,
                    label: {
                      normal: {
                        formatter: '{b}:{c}台',
                        textStyle: {
                          fontSize: 14,
                          fontWeight: 'bold'
                        }
                      }
                    },
                    labelLine: {
                      normal: {
                        show: true
                      }
                    },
                    data: pieData
                  }
                ]
              };
              chart.setOption(option);
            }
          });
        };
        GetProductFamilyInfo();

        //各中心剩余任务
        function GetWorkcenterNotFinishedInfo() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSKaoHeLookBoard.ashx?type=GetWorkcenterNotFinishedInfo",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
            },
            success: function (result) {
              var data = JSON.parse(result);
              for (var i = 0; i < data.length; i++) {
                $("#taskInfo .layui-card-header").eq(i).text(data[i]["WORKCENTERNAME"]);
                $("#taskInfo .yfzs").eq(i).text(data[i]["notFinish"]);
              }
            }
          });
        }
        GetWorkcenterNotFinishedInfo();

        //各中心任务完成情况(柱状图)
        function GetWorkcenterBarInfo() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSKaoHeLookBoard.ashx?type=GetWorkcenterBarInfo",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
              echarts.dispose(document.getElementById("zxrw"));
              var chart = echarts.init(document.getElementById('zxrw'));
              chart.showLoading({
                text: '数据查询中...',
                effect: 'whirling',
                maskColor: 'transparent',
                textColor: '#ffffff'
              });
            },
            success: function (result) {
              var data = JSON.parse(result);

              echarts.dispose(document.getElementById("zxrw"));
              var chart = echarts.init(document.getElementById('zxrw'));
              chart.hideLoading();

              var arrWorkcentername = [];
              var arrFinish = [];
              var arrNotFinish = [];
              var arrDelay = [];

              for (var i = 0; i < data.length; i++) {
                arrWorkcentername.push(data[i]["WORKCENTERNAME"]);
                arrFinish.push(data[i]["finishQty"]);
                arrNotFinish.push(data[i]["notFinishQty"]);
                arrDelay.push(data[i]["delayQty"]);
              }

              var option = {
                tooltip: {
                  trigger: 'axis',
                  show: false,
                  axisPointer: {
                    type: 'shadow'
                  }
                },
                grid: {
                  left: '1%',
                  right: '1%',
                  bottom: '3%',
                  containLabel: true
                },
                legend: {
                  data: ['已完成', '剩余', '超期'],
                  x: '10',
                  y: '10',
                  textStyle: {
                    fontSize: '12',
                    fontWeight: 'bold',
                    color: '#fff'
                  }
                },
                color: ['#32CD32', 'yellow', 'red'],
                xAxis: [{
                  type: 'category',
                  axisTick: {
                    alignWithLabel: true
                  },
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  data: arrWorkcentername
                }],
                yAxis: [{
                  type: 'value',
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,

                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  splitLine: {
                    show: false,
                    lineStyle: {
                      color: '#999',
                      type: 'dashed'
                    }
                  }
                }],
                series: [{
                  name: '已完成',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrFinish,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '剩余',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrNotFinish,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '超期',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrDelay,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }]
              };

              chart.on('click', function (params) {
                var config = {};
                config.url = "../handler/board/ZSKaoHeLookBoard.ashx?type=GetWorkcenterBarDetailInfo";
                config.QueryString = {
                  workcentername: params.name,
                  queryType: params.seriesName
                };
                config.title = "各中心任务完成情况--" + params.name + "--" + params.seriesName + "--明细";
                config.method = "post";
                config.cols = [[
                  { type: 'numbers', title: '序号', width: 80 },
                  { field: 'ATTRIBUTEVALUE', title: '发动机号' },
                  { field: 'ORDERTYPENAME', title: '订单类型' },
                  {
                    field: 'FACTORYCOMPLETIONDATE', title: '计划完成时间',
                    templet: function (d) {
                      if (d.FACTORYCOMPLETIONDATE === null) {
                        return "";
                      } else {
                        return d.FACTORYCOMPLETIONDATE.split('T')[0];
                      }
                    }
                  },
                  {
                    field: 'FINISHDATE', title: '实际完成时间',
                    templet: function (d) {
                      if (d.FINISHDATE === null) {
                        return "";
                      } else {
                        return d.FINISHDATE.split('T')[0];
                      }
                    }
                  },
                  { field: 'QTY', title: '剩余任务单' },
                  { field: 'DELAYDAYS', title: '超期天数' }

                ]];
                openDialog(config);
              });
              chart.setOption(option);
            }
          });
        };
        GetWorkcenterBarInfo();

        //生产工区考核--(超期生产任务、未达标管理任务、考核得分)
        function GetWorkcenterKaoHe() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSKaoHeLookBoard.ashx?type=GetWorkcenterKaoHe",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            success: function (result) {
              var data = JSON.parse(result);

              for (var i = 0; i < data.length; i++) {
                $("#workcenter .layui-card-header").eq(i).find(".wc-title").eq(0).text(data[i]["WORKCENTERNAME"].substring(2)).attr('title', data[i]["WORKCENTERNAME"]);
                $("#workcenter .layui-card-body").eq(i).find(".cqrw").eq(0).text(data[i]["delayQty"]);
                $("#workcenter .layui-card-body").eq(i).find(".wdbrw").eq(0).text(data[i]["wdbQty"]);
                $("#workcenter .layui-card-body").eq(i).find(".wc-score").eq(0).text(data[i]["score"]);
              }

              //超期生产任务弹窗
              $(".cqrw").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.QueryString = { workcentername: workcentername, type: "GetWorcenterDelayDetails" };
                    config.title = workcentername + "--超期生产任务明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'ATTRIBUTEVALUE', title: '发动机号' },
                      { field: 'ORDERTYPENAME', title: '订单类型' },
                      {
                        field: 'FACTORYCOMPLETIONDATE', title: '计划完成时间',
                        templet: function (d) {
                          if (d.FACTORYCOMPLETIONDATE === null) {
                            return "";
                          } else {
                            return d.FACTORYCOMPLETIONDATE.split('T')[0];
                          }
                        }
                      },
                      {
                        field: 'FINISHDATE', title: '实际完成时间',
                        templet: function (d) {
                          if (d.FINISHDATE === null) {
                            return "";
                          } else {
                            return d.FINISHDATE.split('T')[0];
                          }
                        }
                      },
                      { field: 'QTY', title: '剩余任务单' },
                      {
                        field: 'DELAYDAYS', title: '超期天数', align: 'center', width: '15%',
                        templet: function (d) {
                          if (d.DELAYDAYS < 0) {
                            return -1 * d.DELAYDAYS;
                          } else {
                            return d.DELAYDAYS;
                          }
                        }
                      }
                    ]];
                    openDialog(config);
                  }
                });
              });

              //未达标管理任务弹窗
              $(".wdbrw").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.QueryString = { workcentername: workcentername, type: "GetWorcenterWdbDetails" };
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.title = workcentername + "--未达标管理任务明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'OPERATIONCONTENT', title: '任务名称' },
                      { field: 'OPERATIONTYPE', title: '任务类型' },
                      {
                        field: 'RESULTDATE', title: '任务时间',
                        templet: function (d) {
                          if (d.RESULTDATE !== null || d.RESULTDATE !== undefined) {
                            return d.RESULTDATE.split('T')[0];
                          }
                        }
                      },
                      { field: 'LOCALTIME', title: '时间' },
                      { field: 'CYCLE', title: '频次' },
                      { field: 'DEALCOUNT', title: '完成次数' },
                      { field: 'FULLNAME', title: '责任人' },
                      {
                        field: 'STATUS', title: '状态预警',
                        templet: function (d) {
                          if (d.STATUS === "已达标") {
                            return "<span style='color:green;'>" + d.STATUS + "<span>";
                          } else {
                            return "<span style='color:red;'>" + d.STATUS + "<span>";
                          }
                        }
                      }
                    ]];
                    openDialog(config);
                  }
                });
              });

              //考核得分弹窗
              $(".wc-score").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.QueryString = { workcentername: workcentername, factoryid: $factoryid, type: "GetWorkcenterScoreDetails" };
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.title = workcentername + "--考核得分明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'typename', title: '考核项类型' },
                      { field: 'ratio', title: '系数' },
                      { field: 'expression', title: '计算公式', width: 300 },
                      { field: 'qty', title: '未达标数（超期数）' },
                      { field: 'total', title: '总数' },
                      { field: 'score', title: '该项得分' }
                    ]];
                    openDialog(config);
                  }
                });
              });

            }
          });
        };
        GetWorkcenterKaoHe();

        //处室考核--（超期问题上报、未达标管理任务、考核得分）
        function GetChuShiKaoHe() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSKaoHeLookBoard.ashx?type=GetChuShiKaoHe",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            success: function (result) {
              var data = JSON.parse(result);

              for (var i = 0; i < data.length; i++) {
                $("#chushi .layui-card-header").eq(i).find(".wc-title").eq(0).text(data[i]["WORKCENTERNAME"].substring(2)).attr('title', data[i]["WORKCENTERNAME"]);
                $("#chushi .layui-card-body").eq(i).find(".cs-problem").eq(0).text(data[i]["chaoqi"]);
                $("#chushi .layui-card-body").eq(i).find(".cs-wdbrw").eq(0).text(data[i]["wdbQty"]);
                $("#chushi .layui-card-body").eq(i).find(".cs-score").eq(0).text(data[i]["score"]);
              }

              //超期问题上报弹窗
              $(".cs-problem").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.QueryString = { resWorkcenter: workcentername, factoryid: $factoryid, type: "GetChuShiDelayProblem" };
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.title = workcentername + "--超期生产问题明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'DESCRIPTION', title: '问题描述' },
                      { field: 'WORKCENTERNAME', title: '责任单位' },
                      { field: 'FULLNAME', title: '责任人' },
                      {
                        field: 'UFCCHULIDATE', title: '要求完成日期',
                        templet: function (d) {
                          if (d.UFCCHULIDATE === null) {
                            return "";
                          } else {
                            return d.UFCCHULIDATE.split('T')[0];
                          }
                        }
                      },
                      { field: 'CREATEPERSON', title: '提出人' },
                      {
                        field: 'UFCCREATEDATE', title: '提出时间',
                        templet: function (d) {
                          if (d.UFCCREATEDATE === null) {
                            return "";
                          } else {
                            return d.UFCCREATEDATE.split('T')[0];
                          }
                        }
                      },
                      { field: 'UFCRESULT', title: '处理意见' },
                      { field: 'DELAYDAY', title: '超期天数' }
                    ]];
                    openDialog(config);
                  }
                });
              });

              //未达标管理任务弹窗
              $(".cs-wdbrw").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.QueryString = { workcentername: workcentername, type: "GetWorcenterWdbDetails" };
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.title = workcentername + "--未达标管理任务明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'OPERATIONCONTENT', title: '任务名称' },
                      { field: 'OPERATIONTYPE', title: '任务类型' },
                      { field: 'RESULTDATE', title: '任务时间' },
                      { field: 'LOCALTIME', title: '时间' },
                      { field: 'CYCLE', title: '频次' },
                      { field: 'DEALCOUNT', title: '完成次数' },
                      { field: 'FULLNAME', title: '责任人' },
                      {
                        field: 'STATUS', title: '状态预警',
                        templet: function (d) {
                          if (d.STATUS === "已达标") {
                            return "<span style='color:green;'>" + d.STATUS + "<span>";
                          } else {
                            return "<span style='color:red;'>" + d.STATUS + "<span>";
                          }
                        }
                      }
                    ]];
                    openDialog(config);
                  }
                });
              });

              //考核得分弹窗
              $(".cs-score").each(function () {
                var _this = $(this);
                var className = _this.attr("class");
                var workcentername = _this.parent().parent().parent().parent().find(".wc-title").eq(0).attr("title");

                _this.on('click', function (e) {
                  if (_this.text() === "0") {
                    layer.alert('无明细信息数据', { icon: 7, title: "提示" });
                    return
                  } else {
                    var config = {};
                    config.QueryString = { workcentername: workcentername, factoryid: $factoryid, type: "GetChushiScoreDetails" };
                    config.url = "../handler/board/ZSKaoHeLookBoard.ashx";
                    config.title = workcentername + "--考核得分明细";
                    config.method = "post";
                    config.cols = [[
                      { type: 'numbers', title: '序号', width: 80 },
                      { field: 'typename', title: '考核项类型' },
                      { field: 'ratio', title: '系数' },
                      { field: 'expression', title: '计算公式', width: 300 },
                      { field: 'qty', title: '未达标数（超期数）' },
                      { field: 'total', title: '总数' },
                      { field: 'score', title: '该项得分' }
                    ]];
                    openDialog(config);
                  }
                });
              });
            }
          });
        };
        GetChuShiKaoHe();

      });
    });
  </script>
</body>

</html>